package com.starwish.starwishblog.mapper;

import com.starwish.starwishblog.entity.Advice;
import com.starwish.starwishblog.entity.Body;
import com.starwish.starwishblog.vo.AdviceVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Repository
public interface AdviceMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AdviceVo adviceVo);

    Advice selectByPrimaryKey(Integer id);

    List<Advice> selectAll();

    int updateByPrimaryKey(AdviceVo adviceVo);

    int deleteById(int id);

    int cancelById(@Param("id") Integer id,@Param("status") Integer status);

    int topById(@Param("id") Integer id,@Param("status")Integer status);

    List<AdviceVo> selectAdviceByCons(@Param("title") String title);


    List<AdviceVo> selectAdviceByWeight(@Param("title") String title);

    List<Body> selectBodyAll();


    List<AdviceVo> selectAdviceByImportance();
}